package gui.jmenubar.jmenu;

import java.awt.event.MouseEvent;

import javax.media.opengl.GL;
import javax.swing.JMenuItem;

public class JMenuModo extends JMenuApp{

	private static final long serialVersionUID = 1L;
	
	public JMenuModo(){
		initComponents();
	}

	private void initComponents() {
		setText("Modo");
		
		JMenuItem jMenuItem = new JMenuItem();
		jMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
				java.awt.event.KeyEvent.VK_G,
				java.awt.event.InputEvent.CTRL_MASK));
		jMenuItem.setText("Poligonos");
		jMenuItem.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mousePressed(java.awt.event.MouseEvent evt) {
				jMenuItemPoligonoMouseClicked(evt);
			}

			private void jMenuItemPoligonoMouseClicked(MouseEvent evt) {
				jTab.setFormatoDibujo(GL.GL_POLYGON);				
			}
		});
		add(jMenuItem);

		jMenuItem = new JMenuItem();
		jMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
				java.awt.event.KeyEvent.VK_L,
				java.awt.event.InputEvent.CTRL_MASK));
		jMenuItem.setText("Lineas");
		jMenuItem.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mousePressed(java.awt.event.MouseEvent evt) {
				jMenuItemLineasMouseClicked(evt);
			}

			private void jMenuItemLineasMouseClicked(MouseEvent evt) {
				jTab.setFormatoDibujo(GL.GL_LINE_LOOP);
			}
		});
		add(jMenuItem);

		jMenuItem = new JMenuItem();
		jMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
				java.awt.event.KeyEvent.VK_P,
				java.awt.event.InputEvent.CTRL_MASK));
		jMenuItem.setText("Puntos");
		jMenuItem.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mousePressed(java.awt.event.MouseEvent evt) {
				jMenuItemPuntosMouseClicked(evt);
			}

			private void jMenuItemPuntosMouseClicked(MouseEvent evt) {
				jTab.setFormatoDibujo(GL.GL_POINTS);				
			}
		});
		add(jMenuItem);
	}
}
